package logic

import (
	"ViewSrv/global/model"
	"context"

	"ViewSrv/internal/svc"
	"ViewSrv/view"

	"github.com/zeromicro/go-zero/core/logx"
)

type VideoListHotLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewVideoListHotLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VideoListHotLogic {
	return &VideoListHotLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *VideoListHotLogic) VideoListHot(in *view.VideoListHotRequest) (*view.VideoListHotResponse, error) {
	// todo: add your logic here and delete this line
	words := model.RDB.ZRevRange(model.Ctx, "hot", 0, 5).Val()
	return &view.VideoListHotResponse{
		List: words,
	}, nil
}
